<!DOCTYPE html>
<html lang="en">
<head>
<{include file="public_html/header_tag.html"}>
    <title>在线报名</title>
    <link href="/static/public/layer/src/css/layui.css" rel="stylesheet">
    <script src="/static/public/layer/src/layui.js"></script>
    <script>
      $(function(){

        if(<{$logged_in}> == 0) {
            iframe_index = layer.open({
               type: 2,
               area: ['420px', '430px'],
               fixed: false, //不固定
               maxmin: false,
               shadeClose: false,
               closeBtn: 0,
               title: false,
               content: ['/login/iframe', 'no']
             });
        }
      })

      function login_success(){
        parent.layer.close(iframe_index);
        window.location.href=window.location.href;
        window.location.reload;
      }
    </script>
</head>
<body>
<div class="wrap">
	<!--star header-->
    <div class="header">
<{include file="public_html/header_menu.html"}>
    </div>
	<!--end  header-->

    <div class="return_nav">
    	<div class="w1200 line-bottom">
        您的位置：<a href="/">首页</a><span>&gt;</span><a href="/banke">面授课</a><span>&gt;</span><em>在线报名</em>
        </div>
    </div>
	<!--star main-->
    <div class="wrap_main fix">
        <!--content star-->
        <div class="col_main">
            <!--star提交订单-->
            <div class="box_item m-t30 tijiaoLC">
            	<div class="mt fix LH50 line-bottom">
                	<div class="tit l fs26 c-1aa3fa">报名详情</div>
                    <div class="city_path r">
                        <ul>
                            <li><div class="u1"><i class="u1">1</i></div><span>选择课程</span></li>
                            <li class="curr"><div class="u1"><i class="u1">2</i></div><span>填写报名信息</span></li>
                            <li><div class="u1"><i class="u1">3</i></div><span>报名成功</span></li>
                        </ul>
                    </div>
                </div>
                <div class="mc fix LH40 fs18">

                  <div class="fix line-all b-FFFFFF p30">
                   <form class="layui-form" method="post" class="edit_info">
                    <div class="layui-form-item">
                        <label class="layui-form-label">选择校区</label>
                        <div class="layui-input-inline">
                          <select name="campus" id="campus" lay-filter="aihao" lay-verify="required">
                            <option value="">请选择报名校区</option>
                            <{if empty($campus)}>
                              <option value="0">总部校区</option>
                            <{else}>
                            <{foreach from=$campus item=item}>
                              <option value="<{$item['id']}>"><{$item['name']}></option>
                            <{/foreach}>
                            <{/if}>
                            </select>
                        </div>
                      </div>

                      <div class="layui-form-item" style="padding-top:15px">
                        <label class="layui-form-label">姓名</label>
                        <div class="layui-input-inline">
                          <input value="<{if isset($student)}><{$student['name']}><{/if}>" type="text" name="name" id="name" lay-verify="name" lay-verify="required" autocomplete="off" placeholder="请输入姓名" class="layui-input">
                        </div>

                        <label class="layui-form-label">手机号</label>
                        <div class="layui-input-inline">
                          <input value="<{if isset($student)}><{$student['phone']}><{/if}>" type="number" name="phone" id="phone" oninput="if(value.length>11)value=value.slice(0,11)" lay-verify="phone" lay-verify="required" placeholder="手机号码" autocomplete="off" class="layui-input">
                        </div>
                      </div>
                      <div class="layui-form-item">
                        <label class="layui-form-label">学历</label>
                        <div class="layui-input-inline">
                          <select name="edu" id="edu" lay-filter="aihao" lay-verify="required">
                            <option value=""></option>
                            <{if isset($student)}>
                            <option value="1" <{if $student['edu']==1 }>selected<{/if}> >高中</option>
                            <option value="2" <{if $student['edu']==2 }>selected<{/if}> >大专</option>
                            <option value="3" <{if $student['edu']==3 }>selected<{/if}> >本科</option>
                            <option value="4" <{if $student['edu']==4 }>selected<{/if}> >研究生</option>
                            <option value="9" <{if $student['edu']==9 }>selected<{/if}> >其他</option>
                            <{else}>
                            <option value="1" >高中</option>
                            <option value="2" >大专</option>
                            <option value="3">本科</option>
                            <option value="4">研究生</option>
                            <option value="9">其他</option>
                            <{/if}>

                          </select>
                        </div>

                        <label class="layui-form-label">性别</label>
                        <div class="layui-input-inline">
                          <{if isset($student)}>
                          <input type="radio" name="sex" value="1" title="男" <{if $student['sex']==1 }>checked=""<{/if}> >
                          <input type="radio" name="sex" value="2" title="女" <{if $student['sex']==2 }>checked=""<{/if}> >
                          <{else}>
                          <input type="radio" name="sex" value="1" title="男" checked="">
                          <input type="radio" name="sex" value="2" title="女">
                          <{/if}>


                        </div>
                      </div>


                      <!-- <div class="layui-form-item">
                        <label class="layui-form-label">微信</label>
                        <div class="layui-input-inline">
                          <input value="<{if isset($student)}><{$student['wx']}><{/if}>" placeholder="请填写微信" type="text" name="wx" id="wx"   autocomplete="off" class="layui-input">
                        </div>

                        <div class="layui-inline">
                          <label class="layui-form-label">QQ</label>
                          <div class="layui-input-inline">
                            <input value="<{if isset($student)}><{$student['qq']}><{/if}>" type="text" placeholder="请填写QQ号" name="qq" id="qq" autocomplete="off" class="layui-input">
                          </div>
                        </div>
                      </div> -->




                      <div class="layui-form-item">
                        <label class="layui-form-label">上课时间</label>
                        <div class="layui-input-block">

                          <input type="checkbox" name="class_time[]" value="0" title="不限">
                          <input type="checkbox" name="class_time[]" value="1" title="白天">
                          <input type="checkbox" name="class_time[]" value="2" title="晚上">
                          <input type="checkbox" name="class_time[]" value="3" title="周末">
                          <input type="checkbox" name="class_time[]" value="4" title="工作日">

                        </div>
                      </div>
        

                      <div class="layui-form-item layui-form-text">
                        <label class="layui-form-label">备注信息</label>
                        <div class="layui-input-block">
                          <textarea name="remark" id="remark" style="width:460px;" placeholder="请输入备注内容" class="layui-textarea"><{if isset($student)}><{$student['remark']}><{/if}></textarea>
                        </div>
                      </div>
                      <div class="layui-form-item">
                        <div class="layui-input-block">
                         <button class="btn-ff5a00 p-tblr1045 layui-btn" id="order_submit" lay-submit="" lay-filter="demo1">立即报名</button>


                        </div>
                      </div>
                    </form>

                  </div>



                </div>
            </div>
            <!--end提交订单-->
            <div class="fix" style="height:90px;"></div>

        </div>
        <!--content end-->
    </div>
	<!--end  main-->
    <!--star  footer-->
    <div class="footer b-FFFFFF">
      <{include file="public_html/footer.html"}>
    </div>
    <!--end  footer-->
</div>
<script>

layui.use(['form', 'layedit', 'laydate'], function(){
  var form = layui.form()
  ,layer = layui.layer
  ,laydate = layui.laydate;

  //自定义验证规则
  form.verify({
    name: function(value){
      if(value.length < 2){
        return '姓名至少得2个字符啊';
      }
    }
    ,phone: function(value){
      if(!(/^1[34578]\d{9}$/.test(value))){
        return "手机号码有误，请重填";
      }
    }

  });

    var birthday = {
      min: laydate.now(-20000)
      ,max: laydate.now()
      ,istoday: false
      ,choose: function(datas){
        birthday.min = datas; //开始日选好后，重置结束日的最小日期
        birthday.start = datas //将结束日的初始值设定为开始日
      }
    };


    document.getElementById('birthday').onclick = function(){
      birthday.elem = this;
      laydate(birthday);
    }


  //监听提交
  form.on('submit(demo1)', function(data){

    if(<{$logged_in}> == 0) {
      alert("请登录");
      return false;
    }
    var class_time =[];
    $('input[name="class_time[]"]:checked').each(function(){
      class_time.push($(this).val());
    });
    if(class_time.length==0){
      class_time = "";
    }
    if(class_time==""){
      layer.msg('请选择上课时间');
      return false;
    }

  });


});
</script>
</body>
</html>
